// 单行文本溢出省略
@mixin ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// 多行文本溢出省略
@mixin multi-line-ellipsis {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

// 去除docker栏
@mixin layout-remove-docker {
  width: 100%;
  height: 100%;
  padding-bottom: 13.0667vw;
  overflow: hidden;
}

// 去除docker栏的页面布局
@mixin page-layout {
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

/* 登录注册页面 */
@mixin login-portrait {
  margin: 0 auto 10.6667vw;
  width: 17.6vw;
  height: 17.6vw;

  img {
    width: 100%;
  }
}

@mixin login-info {
  display: flex;
  flex-direction: column;
  align-items: center;

  input {
    background: #F9F9F9;
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 6px;
    margin-bottom: 16px;
    padding: 0 16px;

    &::placeholder {
      font-size: 16px;
      color: rgba(0, 0, 0, 0.50);
    }
  }

  button {
    margin: 16px 0;
    background: #0091FF;
    box-shadow: 0 4px 8px rgba(0, 145, 255, 0.32);
    border-radius: 4px;
    border: none;
    color: $white;
  }

  &-item {
    width: 69.0667vw;
    height: 48px;
  }
}

@mixin login-text {
  text-align: center;

  a {
    color: $theme-font-color;
    font-size: 14px;
  }
}

/* 购物车、订单标题 */
@mixin title {
  position: fixed;
  top: 0;
  width: 100%;
  left: 0;
  background-color: $white;
  height: 11.7333vw;
  line-height: 11.7333vw;
  text-align: center;
  font-size: 16px;
  color: $theme-font-color;
  font-weight: bold;
}

// 垂直水平居中
@mixin item-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

// 地址相关页面通用布局
@mixin address-layout {
  background-color: $background-color;
  width: 100%;
  height: 100%;
  padding-top: 11.7333vw;
  overflow-y: auto;
}

// 编辑地址页面相关布局
@mixin create-edit-address {
  &-info {
    margin-top: 12px;
    background-color: $white;
    padding: 0 18px;

    .info-content {
      height: 11.7333vw;
      font-size: 14px;
      display: flex;
      align-items: center;

      &+.info-content {
        border-top: 1px solid #f1f1f1;
      }

      .info-item {
        color: #666666;
        margin-right: 10px;
      }

      .info-text {
        color: #333333;
        flex: auto;

        &::placeholder {
          color: #999999;
        }
      }
    }
  }
}

// 订单详情页商品样式
@mixin add-sub-btn {
  .sub {
    flex: auto;
    display: flex;
    justify-content: flex-end;

    &-btn {
      width: 20px;
      height: 20px;
      color: #666666;
      border: 1px solid #666666;
      border-radius: 10px;
      font-size: 20px;
      @include item-center;
      padding-bottom: 3px;
    }

    &-count {
      margin: 0 10px;
      align-self: center;
    }
  }

  .add {
    width: 20px;
    height: 20px;
    color: $white;
    background-color: #0091FF;
    border-radius: 10px;
    font-size: 20px;
    @include item-center;
    padding-bottom: 3px;
  }
}

@mixin content-name {
  flex: auto;

  &-name {
    font-size: 14px;
    color: $theme-font-color;
    margin-bottom: 2.5vw;
    font-weight: bold;
  }
}

@mixin content-info {
  display: flex;
  align-items: center;
  justify-content: space-between;

  .price {
    font-size: 14px;
    color: $remind-color;
    margin-right: 5px;
  }

  .oldPrice {
    font-size: 12px;
    color: #999999;
    text-decoration: line-through;
    transform-origin: left center;
    transform: scale(.8333);
    flex: auto;
    justify-self: flex-start;
  }
}
/* 确认订单页弹出层样式 */
@mixin toast {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.50);
  @include item-center();
  .modal{
    width: 80vw;
    height: 41.6vw;
    background-color: $white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    flex-direction: column;
  }
}